package com.github.ilioili.justdoit.model.pojo;

import com.github.ilioili.justdoit.util.sql.SqlField;

import java.io.Serializable;

/**
 * Created by hantuo on 16/5/6.
 */
public class ScheduleEvent implements Serializable {

    @SqlField(type = SqlField.SqlType.PRIMARY_KEY)
    public long id;
    public String name;
    public int color;
    public int importance;//0重要&紧急， 1紧急&不重要， 2重要&不紧急， 3不重要&不紧急

    public String categoryId;
    public boolean isComplete;
    public boolean isRepeat;
    public int repeatFlag;
    public boolean alarm;
    public int alermHour;
    public int alermMinute;
    public int type;
    public int timeSpent;//花费的时间, 单位分钟
    public int reward = 30;//奖励的点数 0~100;
    public String remark;//备注

    public long createTime;//开始时间
    public long startTime;//开始时间
    public long endTime;//结束时间

    public ScheduleEvent() {
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ScheduleEvent that = (ScheduleEvent) o;

        if (id != that.id) return false;
        if (color != that.color) return false;
        if (importance != that.importance) return false;
        if (isRepeat != that.isRepeat) return false;
        if (repeatFlag != that.repeatFlag) return false;
        if (alarm != that.alarm) return false;
        if (alermHour != that.alermHour) return false;
        if (alermMinute != that.alermMinute) return false;
        if (createTime != that.createTime) return false;
        if (startTime != that.startTime) return false;
        if (endTime != that.endTime) return false;
        return name != null ? name.equals(that.name) : that.name == null;

    }

    @Override
    public int hashCode() {
        return (int) (id ^ (id >>> 32));
    }
}
